//
//  NumberFormatter.swift
//  Documentation
//
//  Created by Toj on 7/24/23.
//

import CoreFoundation

open class NumberFormatter : Formatter, @unchecked Sendable {
    
    @available(iOS 8.0, *)
    open var formattingContext: Formatter.Context
    
    open func getObjectValue(_ obj: AutoreleasingUnsafeMutablePointer<AnyObject?>?, for string: String, range rangep: UnsafeMutablePointer<NSRange>?) throws
    
    open func string(from number: NSNumber) -> String?
    
    open func number(from string: String) -> NSNumber?
    
    @available(iOS 4.0, *)
    // 初始化方法, 指明number是什么类型的值
    open class func localizedString(from num: NSNumber, number nstyle: NumberFormatter.Style) -> String
    
    open class func defaultFormatterBehavior() -> NumberFormatter.Behavior
    
    open class func setDefaultFormatterBehavior(_ behavior: NumberFormatter.Behavior)
    
    /// 数字类型
    open var numberStyle: NumberFormatter.Style
    
    open var locale: Locale!
    
    open var generatesDecimalNumbers: Bool
    
    open var formatterBehavior: NumberFormatter.Behavior
    
    open var negativeFormat: String!
    
    open var textAttributesForNegativeValues: [String : Any]?
    
    /// 设置格式 "###,###.##"
    open var positiveFormat: String!
    
    open var textAttributesForPositiveValues: [String : Any]?
    
    open var allowsFloats: Bool
    
    /// 整数与小数部分分隔符
    open var decimalSeparator: String!
    
    open var alwaysShowsDecimalSeparator: Bool
    
    open var currencyDecimalSeparator: String!
    
    /// 是否使用组
    open var usesGroupingSeparator: Bool
    /// 组分隔符
    open var groupingSeparator: String!
    
    // 零符号
    open var zeroSymbol: String?
    
    open var textAttributesForZero: [String : Any]?
    
    open var nilSymbol: String
    
    open var textAttributesForNil: [String : Any]?
    
    open var notANumberSymbol: String!
    
    open var textAttributesForNotANumber: [String : Any]?
    
    open var positiveInfinitySymbol: String
    
    open var textAttributesForPositiveInfinity: [String : Any]?
    
    open var negativeInfinitySymbol: String
    
    open var textAttributesForNegativeInfinity: [String : Any]?
    
    /// 自定义前缀
    open var positivePrefix: String!
    /// 自定义后缀
    open var positiveSuffix: String!
    
    open var negativePrefix: String!
    
    open var negativeSuffix: String!
    
    // 货币代码USD
    open var currencyCode: String!
    // 货币符号$
    open var currencySymbol: String!
    // 国际货币符号USD
    open var internationalCurrencySymbol: String!
    // 百分比符号%
    open var percentSymbol: String!
    // 千分号符号‰
    open var perMillSymbol: String!
    // 减号符号-
    open var minusSign: String!
    // 加号符号+
    open var plusSign: String!
    // 指数符号E
    open var exponentSymbol: String!
    
    /// 每组大小
    open var groupingSize: Int
    // 除了groupingSize决定的尺寸外,其他数字位分割的尺寸
    open var secondaryGroupingSize: Int
    // 缩放因子,你可以将一个数缩放指定比例,然后给其添加后缀,
    // 如传入一个3000,你希望表示为3千,就要用到这个属性
    @NSCopying open var multiplier: NSNumber?
    
    /// 格式化长度, 不足paddingCharacter补位
    open var formatWidth: Int
    /// 补位字符
    open var paddingCharacter: String!
    
    /// 补位位置
    open var paddingPosition: NumberFormatter.PadPosition
    
    /// 舍入模式
    open var roundingMode: NumberFormatter.RoundingMode
    
    /// 舍入值,比如以10为进位值,那么156就进位为160,154进位为150
    @NSCopying open var roundingIncrement: NSNumber!
    
    /// 设置最小整数位数（不足的前面补0）
    open var minimumIntegerDigits: Int
    /// 设置最多整数位数（超过的直接截断）
    open var maximumIntegerDigits: Int
    
    /// 设置小数点后最少位, 未达到最大位（不足补0）
    open var minimumFractionDigits: Int
    /// 设置小数点后最多位
    open var maximumFractionDigits: Int
    
    @NSCopying open var minimum: NSNumber?
    
    @NSCopying open var maximum: NSNumber?
    
    @available(iOS 2.0, *)
    open var currencyGroupingSeparator: String!
    
    @available(iOS 2.0, *)
    open var isLenient: Bool
    
    @available(iOS 2.0, *)
    open var usesSignificantDigits: Bool
    
    @available(iOS 2.0, *)
    // 最少有效数字个数
    open var minimumSignificantDigits: Int
    
    @available(iOS 2.0, *)
    // 最大有效数字个数
    open var maximumSignificantDigits: Int
    
    @available(iOS 2.0, *)
    open var isPartialStringValidationEnabled: Bool
}

/*
 {
 
 @available(iOS 8.0, *)
 open var formattingContext: Formatter.Context
 
 open func getObjectValue(_ obj: AutoreleasingUnsafeMutablePointer<AnyObject?>?, for string: String, range rangep: UnsafeMutablePointer<NSRange>?) throws
 
 open func string(from number: NSNumber) -> String?
 
 open func number(from string: String) -> NSNumber?
 
 open class func defaultFormatterBehavior() -> NumberFormatter.Behavior
 
 open class func setDefaultFormatterBehavior(_ behavior: NumberFormatter.Behavior)
 
 open var locale: Locale!
 
 open var generatesDecimalNumbers: Bool
 
 open var formatterBehavior: NumberFormatter.Behavior
 
 open var negativeFormat: String!
 
 open var textAttributesForNegativeValues: [String : Any]?
 
 open var textAttributesForPositiveValues: [String : Any]?
 
 open var allowsFloats: Bool
 
 open var alwaysShowsDecimalSeparator: Bool
 
 open var currencyDecimalSeparator: String!
 
 open var textAttributesForZero: [String : Any]?
 
 open var nilSymbol: String
 
 open var textAttributesForNil: [String : Any]?
 
 open var notANumberSymbol: String!
 
 open var textAttributesForNotANumber: [String : Any]?
 
 open var positiveInfinitySymbol: String
 
 open var textAttributesForPositiveInfinity: [String : Any]?
 
 open var negativeInfinitySymbol: String
 
 open var textAttributesForNegativeInfinity: [String : Any]?
 
 open var negativePrefix: String!
 
 open var negativeSuffix: String!
 
 @NSCopying open var minimum: NSNumber?
 
 @NSCopying open var maximum: NSNumber?
 
 @available(iOS 2.0, *)
 open var currencyGroupingSeparator: String!
 
 @available(iOS 2.0, *)
 open var isLenient: Bool
 
 @available(iOS 2.0, *)
 open var usesSignificantDigits: Bool
 
 @available(iOS 2.0, *)
 open var isPartialStringValidationEnabled: Bool
 }
 */
